﻿<%@ Page Title="个人中心" Language="C#" MasterPageFile="~/CustomPersonalCenter.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Things.Web.PersonalCenter.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="774" height="31" border="0" cellpadding="0" cellspacing="0" class="tab15">
      <tr>
        <td width="5"></td>
        <td width="762" align="left" class="tdl">订单中心</td>
      </tr>
    </table>
      <table width="773" height="44" border="0" cellpadding="0" cellspacing="0" class="tab5">
      <tr>
        <td width="133" align="center" valign="middle"><label for="select"></label>
            <asp:DropDownList ID="ddlDate" runat="server">
                <asp:ListItem Value="0">所有订单</asp:ListItem>
                <asp:ListItem Value="1">一周之内</asp:ListItem>
                <asp:ListItem Value="2">一个月内</asp:ListItem>
                <asp:ListItem Value="3">三个月内</asp:ListItem>
            </asp:DropDownList>
         </td>
        <td width="91" align="center" valign="middle">
            &nbsp;</td>
        <td width="270" align="center" valign="middle">&nbsp;</td>
        <td width="208" align="center" valign="middle"><label for="textfield2"></label>
          <input name="textfield2" type="text" id="textfield2" value="订单编号" size="25" onclick="this.value=''" runat="server" /></td>
        <td width="69" align="left" valign="middle">
            <asp:ImageButton ID="ibtSearch" runat="server" ImageUrl="~/Style/images/cx.jpg" 
                width="48" height="25" border="0" onclick="ibtSearch_Click" />
        </td>
      </tr>
    </table>

    <asp:Label ID="Label1" runat="server" Text="没有订单!" Visible="false"></asp:Label>

    <asp:GridView ID="gridView" runat="server" AllowPaging="True"  
         Width="774px" Height="34px" CssClass="tab25" BorderColor="#e4e4e2" BorderWidth="1px" BorderStyle="Dotted"
                                                                 HeaderStyle-BorderStyle="Dotted" HeaderStyle-BackColor="#e4e4e2" HeaderStyle-BorderWidth="1px"  HeaderStyle-BorderColor="#e4e4e2"
        OnPageIndexChanging="gridView_PageIndexChanging" DataKeyNames="GoodsOrdersID"
        OnRowDataBound="gridView_RowDataBound" AutoGenerateColumns="false" PageSize="10"
        RowStyle-HorizontalAlign="Center" onrowcommand="gridView_RowCommand" 
        onrowdeleting="gridView_RowDeleting" onrowupdating="gridView_RowUpdating">
        <Columns>
            <asp:BoundField DataField="GoodsOrdersID" HeaderText="GoodsOrdersID"  SortExpression="GoodsOrdersID" ItemStyle-HorizontalAlign="Center" Visible="false" />
            <asp:HyperLinkField  Target="_blank" ItemStyle-BorderColor="#e4e4e2" ItemStyle-BorderWidth="1px" ItemStyle-BorderStyle="Dotted" HeaderText="订单编号" ControlStyle-Width="122" DataNavigateUrlFields="GoodsOrdersID" DataNavigateUrlFormatString="~/GoodsOrders/ViewOrder.aspx?id={0}"  DataTextField="GoodsOrderNumber"  />
            <asp:TemplateField  ItemStyle-BorderColor="#e4e4e2" ItemStyle-BorderWidth="1px" ItemStyle-BorderStyle="Dotted" HeaderText="订单商品" ControlStyle-Width="236">
                <ItemTemplate>
                    <asp:DataList ID="DataList1" runat="server" RepeatColumns="3" RepeatDirection="Vertical" CssClass="tab2">
                     <ItemTemplate>
                        <table width="70" height="90" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="70" height="90" align="center">
                                    <a id="A1" href='<%#"~/Goods/Goods.aspx?ID="+ Eval("GoodsPriceID")%>' runat="server" target="_blank">
                                     <asp:Image ID="Image1" runat="server" ImageUrl='<%# "../GetImages.ashx?id="+ Eval("GoodsPriceID") +"&ClassName=ClassGoodsList" %>' 
                                            Width="60px" Height="80px" />
                                </a>
                                </td>
                            </tr>
                        </table>
                        
                     </ItemTemplate>
                    </asp:DataList>
                </ItemTemplate>
            </asp:TemplateField>
             <asp:TemplateField  ItemStyle-BorderColor="#e4e4e2" ItemStyle-BorderWidth="1px" ItemStyle-BorderStyle="Dotted" HeaderText="收货人" ControlStyle-Width="86">
                <ItemTemplate>
                    <asp:Label ID="lblReceiver" runat="server" Text='<%# GetReceiverName(Eval("BuyerAddress")) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField  ItemStyle-BorderColor="#e4e4e2" ItemStyle-BorderWidth="1px" ItemStyle-BorderStyle="Dotted" DataField="TotalPrice" HeaderText="订单金额" SortExpression="TotalPrice" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="84" />
            <asp:BoundField  ItemStyle-BorderColor="#e4e4e2" ItemStyle-BorderWidth="1px" ItemStyle-BorderStyle="Dotted" DataField="BuyDate" HeaderText="下单时间" SortExpression="BuyDate" ControlStyle-Width="148" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:yyyy-MM-dd hh:mm}" />
            <asp:BoundField  ItemStyle-BorderColor="#e4e4e2" ItemStyle-BorderWidth="1px" ItemStyle-BorderStyle="Dotted" DataField="Status" HeaderText="订单状态" SortExpression="Status" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="96" />
            <asp:TemplateField  ItemStyle-BorderColor="#e4e4e2" ItemStyle-BorderWidth="1px" ItemStyle-BorderStyle="Dotted" HeaderText="操作" ControlStyle-Width="50">
                <ItemTemplate>
                    <asp:LinkButton ID="lbtPay" runat="server" CommandName="PayOrder" Text="付款"></asp:LinkButton>
                    <asp:LinkButton ID="lbtCancel" runat="server" CommandName="CancelOrder" Text="取消订单"></asp:LinkButton>
                    <asp:LinkButton ID="lbtShouHuo" runat="server" CommandName="QueRenShouHuo" Text="确认收货"></asp:LinkButton>
                    <asp:LinkButton ID="lbtView" runat="server" CommandName="ViewOrder" Text="查看订单" Visible="false"></asp:LinkButton>
                    <asp:LinkButton ID="lbtComment" runat="server" CommandName="CommentOrder" Text="评论" Visible="false"></asp:LinkButton>                    
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

</asp:Content>
